package com.shujia.jinjie;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class Demo1 {
    public static void main(String[] args) throws Exception{
        //redis中没有该缓存，去业务数据库中查询
        Connection conn = MySqlTool.getConnection();
        PreparedStatement prep = conn.prepareStatement("select * from jd_goods where goods_name=?");
        //select * from jd_goods where goods_name='微星msi星影15游戏本RTX4050笔记本'
        prep.setString(1, "微星msi星影15游戏本RTX4050笔记本");
        ResultSet resultSet = prep.executeQuery();

        if (resultSet.next()){
            String goods_name = resultSet.getString(1);
            String price = resultSet.getString(2);
            String comments = resultSet.getString(3);
            String shop = resultSet.getString(4);
            String icos = resultSet.getString(5);
            System.out.println(goods_name+"|"+price+"|"+comments+"|"+shop+"|"+icos);
        }
    }
}
